﻿using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Text;

namespace ZYHand.IService
{
    public interface IMongoDBService
    {
        public int AddModelbyString(string tableName, string json);
        public long DeleteMany(string tableName, FilterDefinition<ExpandoObject> filter);
        public long UpdateManay(string tableName, Dictionary<string, string> dic, FilterDefinition<ExpandoObject> filter);
        public int AddModel<T>(string tableName, T data) where T : class, new();
        public List<T> FindList<T>(string tableName, FilterDefinition<T> filter, string[] field = null, SortDefinition<T> sort = null) where T : class, new();
        public List<T> FindListByPage<T>(string tableName, FilterDefinition<T> filter, int pageIndex, int pageSize, out long count, string[] field = null, SortDefinition<T> sort = null) where T : class, new();
    }
}
